package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    @Insert("insert into dish_flavor (`dish_id`, `name`, `value`, `create_time`, `update_time`, `create_user`, `update_user`) values (#{dishId},#{name},#{value},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    void insert(DishFlavor flavor);

    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> selectByDishId(String id);

    @Delete("delete from dish_flavor where dish_id = #{id}")
    void deleteByDishId(String id);
}
